#include "Train.h"

class Solution {
public:
    int peakIndexInMountainArray(vector<int>& arr) {
        int l = 1, r = arr.size() - 2;
        while (l < r)
        {
            int mid = l + (r - l + 1) / 2;
            if (arr[mid] > arr[mid - 1]) l = mid;
            else r = mid - 1;
        }
        return r;
    }
};